//
//  UIAlertController+Tools.m
//  MovingLoaniOS
//
//  Created by RAIN on 2019/3/23.
//  Copyright © 2019 GWMFC. All rights reserved.
//

#import "UIAlertController+Tools.h"
@implementation UIAlertController (Tools)

+ (void)rg_alertWithMessage:(NSString *)message
           inViewController:(UIViewController *)viewController
                    handler:(void (^ __nullable)(UIAlertAction *action))handler
{
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"温馨提示" message:message preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:handler];

    [cancelAction setValue:[UIColor colorWithRed:51 green:51 blue:51 alpha:1] forKey:@"_titleTextColor"];
    [alert addAction:cancelAction];
    [alert addAction:sureAction];

    [viewController presentViewController:alert animated:YES completion:nil];
}

@end
